#!/bin/bash
read -p "输入数据库名称:" d_name
mysql -uroot -p123456<<EOF
    create database $d_name;
    use $d_name;
    create table student(id int(10),name varchar(20),sex char(10),address char(20),phone char(20),grade char(5));
    insert into student(id,name,sex)values(1,'ljm','female');
quit
EOF
mysql -uroot -p123456 -e"select * from $d_name.student"
